package edu.sctu.wulixia.month6.day20150608;

/**
 * Created by user05 on 2015/6/8.
 */
public class SaleTickets {
    public static void main(String[] args) {


    TicketNumber ticketNumber = new TicketNumber();

        //创建三个线程模拟三个售票窗口
        //利用Runnable
    Thread ticketNumber1 = new Thread(ticketNumber,"窗口一");
    Thread ticketNumber2 = new Thread(ticketNumber,"窗口二");
    Thread ticketNumber3 = new Thread(ticketNumber,"窗口三");

       //启动三个线程，即开始卖票
        ticketNumber1.start();
        ticketNumber2.start();
        ticketNumber3.start();

       //利用Thread
        TicketNumber2 tn1 = new TicketNumber2("窗口一");
        TicketNumber2 tn2 = new TicketNumber2("窗口二");
        TicketNumber2 tn3 = new TicketNumber2("窗口三");

        tn1.start();
        tn2.start();
        tn3.start();
    }
}
